package com.ft.scan.common;

import lombok.*;

/**
 * @author: 幻屹
 * @time: 2024/4/29
 * @destination: 微信openid获取信息
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class WxResult {

    private String openid;

    private String sessionKey;

    private String unionId;

    private int Code;

    private String message;

    public static WxResult success(String openid, String sessionKey, String unionId) {
        WxResult result = new WxResult();
        result.setOpenid(openid);
        result.setSessionKey(sessionKey);
        result.setUnionId(unionId);
        result.setCode(200);
        result.setMessage("Success!");
        return result;
    }

    public static WxResult fail(int code, String errMsg) {

        WxResult result = new WxResult();
        result.setCode(code);
        result.setMessage(errMsg);
        return result;
    }

}
